<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>人脸比对服务管理</title>
      <link href="css/default.css" rel="stylesheet" />
    <script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $.ajax({
                url:"/get_pluginservice_state",
                type: "GET",
                contentType: "application/json; charset=utf-8",
                success:function(data){
                    if(data.data==="NOTEXIST"){
                        $("#btn_start").hide();
                        $("#btn_stop").hide();
                    }else if(data.data==="STOPPED"){
                        $("#btn_start").show();
                        $("#btn_stop").hide();
                    }else if(data.data==="RUNNING"){
                        $("#btn_start").hide();
                        $("#btn_stop").show();
                    }
                }
            })
        });
    </script>
    <script type="text/javascript">
        function start_service(){
            $.ajax({
                url:"/start_pluginservice",
                type: "GET",
                contentType: "application/json; charset=utf-8",
                success:function(){
                    location.reload();
                }
            })
        }

        function stop_service(){
             $.ajax({
                url:"/stop_pluginservice",
                type: "GET",
                contentType: "application/json; charset=utf-8",
                success:function(){
                    location.reload();
                }
            })
        }
    </script>
</head>
<body>
    <table class="Cam_table" rules="cols">
        <th colspan="6">服务管理：</th>
        <tr>
            <td class="Td1">服务状态：</td>
            <td><input type="" id="input_thread_count" value={{info}} /></td>
        </tr>


        <tr style="text-align: center">
            <td colspan="6">
                <input class="button" type="button" id="btn_start" name="update" value="启动" onclick="start_service()">
                <input class="button" type="button" id="btn_stop" name="update" value="停止" onclick="stop_service()">
            </td>
        </tr>
    </table>
</body>
</html>